import store from '@/store'

console.log(store)

// form
// 默认表单对象
export const defaultForm = {}

// 表单项配置
export const formBase = [
  {
    label: '快递单号',
    type: 'input',
    field: 'courierNumber',
  }
]

export const formItemStyle = {
  paddingLeft: '20px',
  margin: 0
}

// table
// 单元格样式
export const cellStyle = {
  background: 'rgba(28, 155, 252, 0.02)',
  color: 'rgb(142, 155, 185)',
  textAlign: 'center',
}

// 表头单元格样式
export const headerCellStyle = {
  background: 'rgba(28, 155, 252, 0.02)',
  color: 'rgb(142, 155, 185)',
  textAlign: 'center'
}

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0
}

// 表格项配置
export const tableBase = [
  {
    label: '会员昵称',
    prop: 'userName'
  },
  {
    label: '所属店铺',
    prop: 'owned_store',
    width: 150
  },
  {
    label: '客户登记时间',
    prop: 'createTime',
    width: 150
  },
  {
    label: '实重',
    prop: 'actualWeight'
  },
  {
    label: '体积重',
    prop: 'volumeWeight',
    width: 150
  },
  {
    label: '尺寸',
    prop: 'cargoDimensions',
    width: 150
  },
  {
    label: '存放库区',
    prop: 'locationName',
    width: '150'
  },
  {
    label: '件数',
    prop: 'pieces',
    width: '150'
  },
  {
    label: '分配库区',
    prop: 'assignedLocation',
    width: '150'
  },
  {
    label: '确认时间',
    prop: 'confirmedTime',
    width: 150
  },
  {
    label: '货物类型',
    prop: 'cargoType',
    width: 150,
    otherOptions: {},
    echo: {
      field: 'cargoType',
      optionsKey: 'cargoName',
      optionsValue: 'id',
      options: store.state.custom_dict.category.map(item => {
        item.id = String(item.id)
        return item
      }),
    },
    operate: {
      type: 'select',
      field: 'cargoType',
      optionsKey: 'cargoName',
      optionsValue: 'id',
      options: store.state.custom_dict.category,
    }
  },
  {
    label: '备注',
    operate: {
      type: 'input',
      field: 'remarks'
    },
    prop: 'remarks'
  }
]
